﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Taobao.common;

namespace TaobaoBot
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
            _instance = this;
            initCTimer();
        }

        public bool isDispose { get; protected set; }

        private void frmMain_Load(object sender, EventArgs e)
        {
            frmURL.Instance.Show(this);

            webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);
            webBrowser1.DocumentTitleChanged += new EventHandler(webBrowser1_DocumentTitleChanged);
            webBrowser1.FileDownload += new EventHandler(webBrowser1_FileDownload);
            webBrowser1.Navigated += new WebBrowserNavigatedEventHandler(webBrowser1_Navigated);
            webBrowser1.Navigating += new WebBrowserNavigatingEventHandler(webBrowser1_Navigating);
            webBrowser1.NewWindow += new CancelEventHandler(webBrowser1_NewWindow);
            webBrowser1.ProgressChanged += new WebBrowserProgressChangedEventHandler(webBrowser1_ProgressChanged);
            webBrowser1.ScriptErrorsSuppressed = false;
            webBrowser1.StatusTextChanged += new EventHandler(webBrowser1_StatusTextChanged);
            //webBrowser1.
        }

        private void frmMain_Shown(object sender, EventArgs e)
        {
            webBrowser1.Navigate(@"http://www.taobao.com/");
            //webBrowser1.Url = @"http://www.taobao.com/";
        }

        private void frmMain_Resize(object sender, EventArgs e)
        {
        }

        private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            disCTimer();
        }

      
        protected void printURL(string url)
        {
            frmURL.Instance.print(url);
        }

        private void settingToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void accountToolStripMenuItem_Click(object sender, EventArgs e)
        {
            User item;
            if (frmUser.Instance.New(out item))
            {

            }
        }

        private void startToolStripMenuItem_Click(object sender, EventArgs e)
        {

        }

        private void homeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Navigate(@"http://www.taobao.com/");
        }

       


    }
}
